package net.huashitong.supervision.task.controller;

import com.sirdc.modules.core.web.JsonBaseController;
import com.sirdc.modules.sys.entity.SysUser;
import com.sirdc.modules.sys.service.DeptService;
import com.sirdc.modules.sys.service.SysDeptService;
import com.sirdc.modules.sys.service.SysLoginService;
import com.sirdc.modules.sys.service.SysUserService;
import com.sirdc.modules.sys.util.SysUserUtils;
import net.huashitong.supervision.task.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2019/8/20
 * Time: 11:39
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Controller
@RequestMapping(value = "/taskUser")
public class TaskUserController extends JsonBaseController{
    @Autowired
    private SysDeptService sysDeptService;
    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private DeptService deptService;
    @Autowired
    private TaskCategoryService categoryService;
    @Autowired
    private TaskMainService taskMainService;
    @Autowired
    private SysLoginService sysLoginService;
    @Lazy
    @Autowired
    private TaskSubService taskSubService;
    @Autowired
    private TaskUserService taskUserService;

    @Autowired
    private TaskUnitService taskUnitService;
    @Autowired
    private TaskCategoryService taskCategoryService;
    @Autowired
    private TaskBackNewService taskBackNewService;

    @Override
    protected String getView(String s) {
        return "/modules/task/taskUser/" + s;
    }


    /**
     * 待办任务列表
     * @param model
     * @return
     */
    @RequestMapping(method = RequestMethod.GET)
    public String initPage(Model model) {
        SysUser user = sysUserService.getById(SysUserUtils.getUserId());
        model.addAttribute("user", user);
        return getView("query");
    }
}
